<#include "header.ftl" />
<@head />
<#include "side.ftl" />
<div class="g-content">
    <div class="g-content-container">
        <div class="g-p">
			<div class="m-content">
				<form name="postForm" id="postForm" action="${spaceUrl}" method="GET">
					<@spring.bind "postPage" />
					<!-- pagination parameter -->
					<@spring.formHiddenInput path="postPage.pageNo" />
					<@spring.formHiddenInput path="postPage.totalPages" />
					<@spring.formHiddenInput path="postPage.totalCount" />
					<!-- sorter parameter -->
					<@spring.formHiddenInput path="postPage.sortEnable" />
					<@spring.formHiddenInput path="postPage.sort.field" />
					<@spring.formHiddenInput path="postPage.sort.order" />
					
				    <div class="none">
				    	<#if (postPage?exists && postPage.result?size > 0)>
				        	<#list postPage.result as post>
						    	<div class="media">
						    		<div class="media-body">
						    			<div class="media-body-title">
						    				<#if post.isTop><span class="post-top">[置顶]</span></#if><strong><a href="<@postUrl id="${post.id}" username="${post.author.name}"/>">${post.title}</a></strong>
						    			</div>
						    			<p class="typo-small"><@contentTransform content="${post.content}" removeHtml=true substring=true endIndex=500 /></p>
						    			<p class="typo-small" style="color:#08c;">
						    				创建时间：${post.createTime?string("yyyy-MM-dd hh:mm:ss")}
						    				分类：${post.catalog.name}
						    				查看：<@postViews id=post.id />&nbsp;&nbsp;&nbsp;&nbsp;
						    			</p>
					    			</div>
					    		</div>
					    	</#list>
			        	</#if>
				    </div>
				    <#if (postPage.totalPages > 1)>
                        <#if cat?has_content>
                       		<@space.pagenavi pageEntity=postPage baseUrl=spaceUrl + "?cat=" + cat + "&page=$page$" />
                        <#else>
                        	<@space.pagenavi pageEntity=postPage baseUrl=spaceUrl + "?page=$page$" />
                        </#if>
                    </#if>
				</form>
			</div>
        </div>
    </div>
</div>
<#include "footer.ftl" />